package com.baseweb.webadmin.core.model.mapper;

import com.baseweb.webadmin.core.model.pojo.ByUserBizAgentCity;
import com.baseweb.webadmin.core.model.pojo.ByUserBizAgentCityExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

public interface ByUserBizAgentCityMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_biz_agent_city
     *
     * @mbggenerated Tue Apr 04 15:38:12 CST 2017
     */
    int countByExample(ByUserBizAgentCityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_biz_agent_city
     *
     * @mbggenerated Tue Apr 04 15:38:12 CST 2017
     */
    int deleteByExample(ByUserBizAgentCityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_biz_agent_city
     *
     * @mbggenerated Tue Apr 04 15:38:12 CST 2017
     */
    @Delete({
        "delete from by_user_biz_agent_city",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_biz_agent_city
     *
     * @mbggenerated Tue Apr 04 15:38:12 CST 2017
     */
    @Insert({
        "insert into by_user_biz_agent_city (province, city, ",
        "create_time, ",
        "update_time, ",
        "user_id)",
        "values (#{province,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, ",
        "#{createTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}, ",
        "#{updateTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}, ",
        "#{userId,jdbcType=INTEGER})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(ByUserBizAgentCity record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_biz_agent_city
     *
     * @mbggenerated Tue Apr 04 15:38:12 CST 2017
     */
    int insertSelective(ByUserBizAgentCity record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_biz_agent_city
     *
     * @mbggenerated Tue Apr 04 15:38:12 CST 2017
     */
    List<ByUserBizAgentCity> selectByExample(ByUserBizAgentCityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_biz_agent_city
     *
     * @mbggenerated Tue Apr 04 15:38:12 CST 2017
     */
    @Select({
        "select",
        "id, province, city, create_time, update_time, user_id",
        "from by_user_biz_agent_city",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    ByUserBizAgentCity selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_biz_agent_city
     *
     * @mbggenerated Tue Apr 04 15:38:12 CST 2017
     */
    int updateByExampleSelective(@Param("record") ByUserBizAgentCity record, @Param("example") ByUserBizAgentCityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_biz_agent_city
     *
     * @mbggenerated Tue Apr 04 15:38:12 CST 2017
     */
    int updateByExample(@Param("record") ByUserBizAgentCity record, @Param("example") ByUserBizAgentCityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_biz_agent_city
     *
     * @mbggenerated Tue Apr 04 15:38:12 CST 2017
     */
    int updateByPrimaryKeySelective(ByUserBizAgentCity record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_biz_agent_city
     *
     * @mbggenerated Tue Apr 04 15:38:12 CST 2017
     */
    @Update({
        "update by_user_biz_agent_city",
        "set province = #{province,jdbcType=VARCHAR},",
          "city = #{city,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler},",
          "user_id = #{userId,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ByUserBizAgentCity record);
}